﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RoleConfig.aspx.cs" Inherits="SysManage_RoleConfig" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>角色配置</title>
    <link rel="stylesheet" href="../Content/redmond/jquery-ui-1.9.2.custom.min.css" type="text/css" />
    <link rel="stylesheet" href="../Content/SysManage.css" type="text/css" />

    <script src="../Scripts/jquery-1.8.3.js" type="text/javascript"></script>

    <script src="../Scripts/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>

    <script src="../Scripts/RoleConfig.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="ContentDiv">
            <p>
                <label for="Role_I" class="lTitle">
                    角色：</label>
                <asp:TextBox ID="Role_I" runat="server" MaxLength="200" CssClass="text ui-widget-content"></asp:TextBox>
                <asp:Button ID="QueryBtn" runat="server" Text="查询" OnClick="QueryBtn_Click" CssClass="BtnLeft" />
            </p>
            <asp:GridView ID="RoleList" runat="server" AutoGenerateColumns="False" EmptyDataText="对不起,未找到相关数据！"
                Width="100%" CssClass="ui-widget ui-widget-content" OnRowCommand="RoleList_RowCommand">
                <HeaderStyle CssClass="ui-widget-header" />
                <Columns>
                    <asp:BoundField DataField="role_name" HeaderText="角色" SortExpression="role_name"/>
                    <asp:BoundField DataField="role_code" HeaderText="代码" SortExpression="role_code" />
                    <asp:BoundField DataField="user_num" HeaderText="用户数" SortExpression="user_num" />
                    <asp:BoundField DataField="page_num" HeaderText="权限数" SortExpression="page_num" />
                    <asp:TemplateField>
                        <ItemStyle HorizontalAlign="Right" />
                        <ItemTemplate>
                            <asp:Button ID="SetPage_G" runat="server" Font-Size="12px" CausesValidation="false"
                                Text="配置权限" CommandName="PageConfig" CommandArgument='<%# Bind("role_code")%>'
                                 CssClass="ui-button ui-state-default ui-corner-all" />
                            <asp:Button ID="SetUser_G" runat="server" Font-Size="12px" CausesValidation="false"
                                Text="配置用户" CommandName="UserConfig" CommandArgument='<%# Bind("role_code")%>' 
                                CssClass="ui-button ui-state-default ui-corner-all"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div style="text-align: right; padding: 5px;">
                <webdiyer:AspNetPager ID="RolePager" runat="server" OnPageChanged="RolePager_PageChanged">
                </webdiyer:AspNetPager>
            </div>
        </div>
        <div id="PageSetDiv" title="角色权限配置" class="DialogDiv">
            <fieldset class="ui-widget ui-widget-content">
                <legend>给角色<label runat="server" id="Role_Name_R"></label>设置权限</legend>
                <span style="font-size:12px; color:#f92;">电脑端</span>  
                <asp:CheckBoxList ID="PageList" runat="server" RepeatLayout="Flow" RepeatColumns="2" CssClass="CKList">
                </asp:CheckBoxList>
               <span style="font-size:12px; color:#f92;">移动端</span> 
               <asp:CheckBoxList ID="PageListM" runat="server" RepeatLayout="Flow" RepeatColumns="2" CssClass="CKList">
                </asp:CheckBoxList> 
               <asp:HiddenField ID="Role_Code_R" runat="server"/> 
            </fieldset>
            <p class="ActionP">
                <asp:Button ID="SetPageBtn" runat="server" Text="权限配置" OnClick="SetPageBtn_Click" />
                <input id="BtnCancelR" type="button" value="取消" />
            </p>
        </div>
        <div id="UserSetDiv" title="角色用户配置" class="DialogDiv">
            <fieldset class="ui-widget ui-widget-content">
                <legend>给角色<label runat="server" id="Role_Name_U"></label>配置用户</legend>
                <asp:CheckBoxList ID="UserList" runat="server" RepeatLayout="Flow" RepeatColumns="2" CssClass="CKList">
                </asp:CheckBoxList>
               <asp:HiddenField ID="Role_Code_U" runat="server"/>  
            </fieldset>
            <p class="ActionP">
                <asp:Button ID="UserBtn" runat="server" Text="配置用户" OnClick="UserBtn_Click" />
                <input id="BtnCancelU" type="button" value="取消" />
            </p>
        </div>
    </form>
</body>
</html>
